Add SOCKS5 proxy support via [proxy] config#575
Open
KaraZajac wants to merge 2 commits intoulyssa:mainfrom
Open
Add SOCKS5 proxy support via [proxy] config#575KaraZajac wants to merge 2 commits intoulyssa:mainfrom
[proxy] config#575KaraZajac wants to merge 2 commits intoulyssa:mainfrom
Conversation
Contributor
|
would fix #80 if this wasn't AI slop that ignores the coding style of this project and doesn't even compile (without openssl available). |
Author
|
Hey thanks! I updated the styling and removed the OpenSSL dependency! I hope it looks better. You are correct that I did have AI's help in creating this. Thank you for taking the time to review the code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional proxy support for Matrix HTTP traffic using reqwest’s
socksfeature and a new[proxy]section in the config. Users can set a global proxy or override it per profile. If no proxy is configured, behavior is unchanged (no proxy and no use ofALL_PROXY).Changes
Cargo
Cargo.toml: Depend onreqwestwith thesocksfeature so the client can use SOCKS5 (and other proxy URLs reqwest supports).Configuration
src/config.rs:ProxyConfigwith optionalurland amerge()for profile override.IambConfigandProfileConfigeach have an optionalproxy: Option<ProxyConfig>.ApplicationSettingsgainsproxy_url: Option<String>; inload(), global and profile proxy are merged (profile overrides global) and the result is stored inproxy_url.HTTP client
src/worker.rs: Increate_client_inner, whensettings.proxy_urlis set, the reqwest client is built withreqwest::Proxy::all(proxy_url). Invalid proxy URL is reported with a clear.expect(...)message at startup.Docs and examples
config.example.toml: Added a commented[proxy]example withurl = "socks5://127.0.0.1:1080".docs/iamb.5: New PROXY section documenting[proxy]andurl, andproxylisted as overridable per profile.Tests
src/tests.rs:mock_settings()updated soProfileConfigincludesproxy: NoneandApplicationSettingsincludesproxy_url: None.Usage
[proxy]withurl = "socks5://host:port"(or another supported proxy URL).proxy = { url = "socks5://..." }under a profile; it overrides the global proxy for that profile.[proxy]or leaveurlunset to use no proxy.